//
// Created by Administrator on 2024/6/4.
//

#include "linkedListUtil.h"
using namespace std;

int findMid(Node * head)
{
    Node *slow = head->next;
    Node *fast = head->next;
    while(fast && fast->next)
    {
        slow=slow->next;
        fast=fast->next->next;
    }
    return slow->v;
}

int main()
{
    vector<int> v{0,1,2,3,4,5,6,7};
    Node *h = build(v);
    printLinkedList(h);
    cout<<findMid(h);
    return 0;
}